Command Line Switches

PreviousUpNext

Beyond Compare can be called from a version control system with filenames given on the command line.

For a 2-way visual diff, use:

bcomp <Left File> <Right File>

For a 3-way merge (where the center file is the common ancestor), use:

bcomp <Left File> <Right File> <Center File> <Output File>

If you want to skip the center file, you can explicitly specify the output file with the /mergeoutput switch:

bcomp <Left File> <Right File> /mergeoutput=<Output File>

To merge the files automatically without the user interface:

bcomp <Left File> <Right File> <Center File> <Output File> /automerge

nix Note  Linux users should prefix the switches with "-" instead of "/".

Here's a summary of supported switches:

Switch

Meaning

/?

Displays command line documentation.

/fv=<type>, /fileviewer=<type>

Opens a new view of the given type.  <type> can be any of:

  "Text Compare"

  "Text Merge"

  "Hex Compare"

  "Data Compare"

  "Picture Compare"

/sync

Opens a Folder Sync view.

/qc=<type>, /quickcompare=<type>

Performs a quick comparison of the two files and sets the DOS ErrorLevel on exit.  <type> can be size, crc, or binary, or can be left off to do a rules-based comparison.  ErrorLevels are documented below.

/mergeoutput=<Output File>

Explicitly specifies merge output file.

/ro, /readonly

View is read-only.

/lro, /ro1, /leftreadonly

Left side is read-only.

/rro, /ro2, /rightreadonly

Right side is read-only.

/cro, /ro3, /centerreadonly

Center is read-only.

/lefttitle=<Title>, /title1=<Title>

Description to show in left path edit.

/righttitle=<Title>, /title2=<Title>

Description to show in right path edit.

/centertitle=<Title>, /title3=<Title>

Description to show in center path edit.

/outputtitle=<Title>, /title4=<Title>

Description to show in output path edit.

/vcsleft=<path>

/vcsright=<path>

/vcscenter=<path>

/vcsoutput=<path>

Path within the version control system.  Used to select appropriate file format.  Shown in the respective path edit if a title isn't given.

/automerge

Automatically merge the files and write to output, without user interaction.  Merge output is not written if conflicts are found.

/force

Used in conjunction with /automerge to create an output file with CVS-style conflict markers if conflicts are found.

/solo

Forces a new instance of the program.

/nobackups

Disables backup file creation.

/ignoreunimportant

Turns on Ignore Unimportant Differences.

/bds <file>

Prompts to compare against previous revisions available in the CodeGear RAD Studio/Borland Developer Studio "__history" folders.  Add to the IDE Tools menu with "/BDS $SAVE $EDNAME" as the parameters or use the Beyond Compare IDE Expert from JED Software, available at www.jed-software.com

/favorleft

/favorright

Non-conflicting changes from "favored" side are drawn without coloring or section lines in the merge output, and ignored unimportant conflicts automatically take changes from that side instead of the center.

/savetarget=<path>

Text Compare's Save command will overwrite the specified file rather than the original file.

/reviewconflicts

Automatically opens the interactive merge if conflicts are found during an /automerge.

/silent

Causes a script to be processed invisibly, bypassing the Task Bar entry and Scripting Status window.  All interaction will be suppressed, so any unresolved issue that would normally show a dialog will log an error instead.

/closescript

Closes the script window on completion.  Overrides the Close when finished setting in Tools > Options > Scripts.

/filters=<file mask>

Specifies filename filters to use in a Folder Compare or Folder Sync session.  Separate multiple file masks with semi-colons.  Surround the mask with quotes if it contains spaces.

/expandall

Initially expands all subfolders in a Folder Compare or Folder Sync session.

 

The following DOS Error Levels are set on exit:

0

Success

1

Binary Same

2

Rules-Based Same

11

Binary Difference

12

Similar

13

Rules-Based Difference

14

Conflicts Detected

100

Unknown error

101

Conflicts Detected.  Merge output not written.

Beyond Compare also supports command lines from ClearCase automatically for interactive and silent comparisons and merges.